package com.elminster.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.elminster.dao.impl.UserDaoImpl;
import com.elminster.entity.base.User;
import com.elminster.service.IUserService;

@Service
@Transactional(readOnly=true, propagation=Propagation.REQUIRED)
public class UserService implements IUserService {
    
    @Autowired
    private UserDaoImpl userDao;
    
    public List<User> searchAllUser() {
        return userDao.findAll();
    }

    public List<User> findUser(User user) {
        return userDao.findByExample(user);
    }

    public int getUserCount() {
        return userDao.getTotalCount();
    }
}